﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPage1.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ComputerShopE3.Models.KEYBOARD>>" %>
<%@ Import Namespace="ComputerShopE3.Controllers" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2 align="center">Danh mục bàn phím</h2>

    <table>
        <tr>
            <% SiteRoles role = SpiderE3AuthorizeAttribute.GetCurrentRole(Context);
                 %>
            <th></th>
            <% ViewData["SanPham"] = null; %>
            <% Html.RenderPartial("ProductListPartialView"); %>
            
            <%--<th>
                id
            </th>--%>
           <%-- <th>
                CongGiaoTiep
            </th>
            <th>
                Mau
            </th>--%>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
            <% if (role == SiteRoles.Admin || role == SiteRoles.Employee)
           { %>
            <%= Html.ActionLink("Chỉnh sửa", "Edit", new { id=item.id }) %> |
        <% } %>
                
                
            </td>
            
            <% ViewData["SanPham"] = item.SAN_PHAM; %>
            <% Html.RenderPartial("ProductListPartialView"); %>
            
            <%--<td>
                <%= Html.Encode(item.id) %>
            </td>--%>
           <%-- <td>
                <%= Html.Encode(item.CongGiaoTiep) %>
            </td>
            <td>
                <%= Html.Encode(item.Mau) %>
            </td>--%>
        </tr>
    
    <% } %>

    </table>

    <p>
        <% if (role == SiteRoles.Admin || role == SiteRoles.Employee)
           { %>
            <%= Html.ActionLink("Tạo mới", "Create")%>
        <% } %>
    </p>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <title>Bàn phím</title>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PersonalMenu" runat="server">
</asp:Content>

